import { request } from "./request";

export function insertGameImg(files) {
  return request({
    url: "/backstage/upload",
    method: "post",
    data: files,
    processData: false,
    contentType: false,
  });
}

export function insertGame(
  giArea,
  giBackdrop,
  giDetails,
  giIntroduce,
  giLogo,
  giName,
  giTitle,
  gjDeveloper,
  gjEdition,
  gjOperator,
  gjSize,
  grImg,
  gtId
) {
  return request({
    url: "/backstage/addGameTwo",
    method: "post",
    params: {
      giArea,
      giBackdrop,
      giDetails,
      giIntroduce,
      giLogo,
      giName,
      giTitle,
      gjDeveloper,
      gjEdition,
      gjOperator,
      gjSize,
      grImg,
      gtId,
    },
  });
}

export function updateGame(
  giArea,
  giBackdrop,
  giDetails,
  giId,
  giIntroduce,
  giLogo,
  giName,
  giTitle,
  gjDeveloper,
  gjEdition,
  gjOperator,
  gjSize,
  grImg,
  gtId
) {
  return request({
    url: "/backstage/updateGame",
    method: "post",
    params: {
      giArea,
      giBackdrop,
      giDetails,
      giId,
      giIntroduce,
      giLogo,
      giName,
      giTitle,
      gjDeveloper,
      gjEdition,
      gjOperator,
      gjSize,
      grImg,
      gtId,
    },
  });
}

export function getUserInfo(pageNum) {
  return request({
    url: "/backstage/getUserInfo",
    method: "post",
    params: {
      pageNum,
    },
  });
}

export function delUserInfo(uId, uState) {
  return request({
    url: "/backstage/delUserInfo",
    method: "post",
    params: {
      uId,
      uState,
    },
  });
}

export function getLikeUserInfo(likeInfo, pageNum) {
  return request({
    url: "/backstage/getLikeUserInfo",
    method: "post",
    params: {
      likeInfo,
      pageNum,
    },
  });
}

export function getFeedback(pageNum) {
  return request({
    url: "/backstage/getFeedback",
    method: "post",
    params: {
      pageNum,
    },
  });
}

export function getGameInformations(pageNum) {
  return request({
    url: "/backstage/getGameInformations",
    method: "post",
    params: {
      pageNum,
    },
  });
}

export function delGaemInformation(giId, giState) {
  return request({
    url: "/backstage/delGaemInformation",
    method: "post",
    params: {
      giId,
      giState,
    },
  });
}

export function getGameInformationLike(likeGame, pageNum) {
  return request({
    url: "/backstage/getGameInformationLike",
    method: "post",
    params: {
      likeGame,
      pageNum,
    },
  });
}

export function getGameInformationById(giId) {
  return request({
    url: "/backstage/getGameInformationById",
    method: "post",
    params: {
      giId,
    },
  });
}

export function getGameType(pageNum) {
  return request({
    url: "/backstage/getGameType",
    method: "post",
    params: {
      pageNum,
    },
  });
}

export function getGameTypeLike(likeType, pageNum) {
  return request({
    url: "/backstage/getGameTypeLike",
    method: "post",
    params: {
      likeType,
      pageNum,
    },
  });
}

export function updateGameType(gtId, gtState) {
  return request({
    url: "/backstage/updateGameType",
    method: "post",
    params: {
      gtId,
      gtState,
    },
  });
}

export function getGameTypeById(gtId) {
  return request({
    url: "/backstage/getGameTypeById",
    method: "post",
    params: {
      gtId,
    },
  });
}

export function addGameTypes(gtImg, gtName) {
  return request({
    url: "/backstage/addGameTypes",
    method: "post",
    params: {
      gtImg,
      gtName,
    },
  });
}

export function updateGameTypes(gtId, gtImg, gtName) {
  return request({
    url: "/backstage/updateGameTypes",
    method: "post",
    params: {
      gtId,
      gtImg,
      gtName,
    },
  });
}
